import {createRouter, createWebHistory} from 'vue-router'

const routes = [
    {
        path: "/",
        redirect: "/AStep",
        name: "home",
        component: () => import("@/components/layout/ALayout.vue"),
        children: [
            {
                name: "AStep",
                path: "/AStep",
                components: {
                    pdfContent: () => import("@/components/pdfContent.vue"),
                    default: () => import("@/pages/AStep.vue"),
                }
            }, {
                name: "BStep",
                path: "/BStep",
                components: {
                    pdfContent: () => import("@/components/pdfContent.vue"),
                    default: () => import("@/pages/BStep.vue"),
                }
            }, {
                name: "CStep",
                path: "/CStep",
                components: {
                    pdfContent: () => import("@/components/pdfContent.vue"),
                    default: () => import("@/pages/CStep.vue"),
                }
            }, {
                name: "DStep",
                path: "/DStep",
                components: {
                    pdfContent: () => import("@/components/pdfContent.vue"),
                    default: () => import("@/pages/DStep.vue"),
                }
            }
        ]
    },
    {
        name: "knowledge",
        path: "/knowledge",
        component: () => import("@/pages/knowledge.vue"),
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes,
    scrollBehavior(to, from, savedPosition) {
        return {x: 0, y: 0};
    },
})
export default router
